﻿using Niknak.Services.TaskScheduler;
using Sandbox.Business;
using Sandbox.Data.Mongo;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Sandbox
{
    class Program
    {
        //static void Main(string[] args)
        //{
        //    Console.WriteLine("Testing task scheduler");
        //    Console.WriteLine("----------------------");
        //    Console.WriteLine();

        //    TestTask task = new TestTask();

        //    if (!string.IsNullOrEmpty(task.Settings.EndDate))
        //        foreach (DateTime iteration in task.Iterations)
        //            Console.WriteLine("Iteration: " + iteration.ToString());

        //    task.Initialise();
            
            
            
            
        //    Console.ReadKey();
        //    task.Shutdown();
        //}

        static void Main(string[] args)
        {
            Engine<ExceptionHandler, ScheduledTask, AuditLog, AuditLogEntry> taskSchedulerEngine = new Engine<ExceptionHandler, ScheduledTask, AuditLog, AuditLogEntry>();
            taskSchedulerEngine.EngineStarting += new EventHandler(taskSchedulerEngine_EngineStarting);
            taskSchedulerEngine.Start();

            Console.ReadKey();

            Console.WriteLine("Shutting down...");
            taskSchedulerEngine.Stop();
        }

        static void taskSchedulerEngine_EngineStarting(object sender, EventArgs e)
        {
            Helper.InitClassMaps();
            //Console.ReadKey();
        }
    }
}
